#pragma once
#include "MovingObject.h"
#include "FOV.h"
#include "Timer.h"
#include "GameplayState.h"


class BaseBehavior;
class Player;


class EnemyUnit : public MovingObject
{
	
public:
	enum AIStates { PATROL, ALERT, WAIT, TO_ALARM, SEARCHING, GO_HOME, ATTACK};
	EnemyUnit() = default;
	~EnemyUnit() = default;

	virtual void			Update(float elapsedTime)	 override;
	virtual void Attack(void) {};
	//virtual void			Render(void)				 override;
	virtual int GetType(void) const override { return OBJ_ENEMY_UNIT; }
	void SetAIState(int newState) { m_nAIState = newState; }
	int GetAIState(void) const { return m_nAIState; }
	void SetNavGraph(Graph<SGD::Point*>* newGraph) { navGraph = newGraph; }
	void SetTarget(Player* _target);
	Player* GetTarget(void) { return m_pTarget; }
	void SetHomeNode(int home) { homeNode = home;}
	void SetAlarmNode(int alarm) { alarmNode = alarm; }

	void FindPath(SGD::Point start, SGD::Point end, std::vector<SGD::Point>&);

	void FOVSetUp(vector<SGD::Rectangle*>&);


protected:

	Timer m_tStunTimer;
	FOV m_FieldOfView;
	int homeNode = 0;
	int alarmNode = 0;
	//AnimTimeStamp m_Animation;
	Player* m_pTarget = nullptr;
	int m_nAIState = 0;
	friend class FOV;

	
	
};

